const db = require('../db/index');
const DataType = require('sequelize');
/**es6继承 会员卡表*/
class Giving extends DataType.Model {}
Giving.init(
    {
        id: {
            type: DataType.INTEGER,
            allowNull: false,
            autoIncrement: true,
            primaryKey: true
        },
        limit: {
            type: DataType.INTEGER,
            comment: '成功注册一个赠送次数',
            defaultValue: 0,
            allowNull: false
        },
        day: {
            type: DataType.INTEGER,
            comment: '成功邀请并够买会员赠送的vip天数',
            defaultValue: 0,
            allowNull: false
        },
        memberId: {
            type: DataType.INTEGER,
            comment: '会员卡ID'
        },
        desc: {
            type: DataType.STRING,
            comment: '描述',
            defaultValue: 0,
            allowNull: false
        },
        type: {
            type: DataType.INTEGER,
            comment: '-1 成功注册赠送 1成功邀请并购买会员',
            defaultValue: -1,
            allowNull: false
        }
    },
    {
        tableName: 'giving',
        modelName: 'giving',
        sequelize: db
    }
);
// Giving.sync({ force: true });
exports['default'] = Giving;
